<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
	


	<p:dialog id="findAcademy" header="#{msgs.FindAcademy}" widgetVar="wfindAcademy" modal="true" style="padding: 0px; margin: 0px;"> 
		<h:form id="findAcademyForm" prependId="false">
			<h:panelGrid columns="2" cellpadding="2">

				<h:outputLabel 	value="#{msgs.Name} :" 	for="findByName" />
				<p:inputText	id="findByName" 		value="#{ academyBean.findByName}" 				maxlength="50" 	size="50" />

				<h:outputLabel 	value="#{msgs.Owner} :" 	for="findByOwner" />
				<p:inputText	id="findByOwner" 		value="#{ academyBean.findByOwner}" 			maxlength="50" 	size="30" />

				<h:outputLabel	value="#{msgs.CNPJ} :" 			for="findByCnpj" />
				<p:inputText id="findByCnpj" 				value="#{academyBean.findByCnpj}"			maxlength="22" size="22" />

				<h:outputLabel	value="#{msgs.Email} :" 			for="findByEmail" />
				<p:inputText id="findByEmail" 				value="#{academyBean.findByEmail}"			maxlength="50" size="51" />

				<h:outputLabel	value="#{ msgs.CreatedAt} :" />
				<h:column>
				<p:calendar		id="begCreatedAt"	value="#{academyBean.begCreatedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true" readOnlyInputText="true"  />
                      #{ msgs.To}
                      <p:calendar		id="endCreatedAt"	value="#{academyBean.endCreatedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true"	readOnlyInputText="true" />
				</h:column>


				<h:outputLabel	value="#{ msgs.ChangedAt} :" />
				<h:column>
				<p:calendar		id="begChangedAt"	value="#{academyBean.begChangedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true" readOnlyInputText="true"  />
                      #{ msgs.To}
                      <p:calendar		id="endChangedAt"	value="#{academyBean.endChangedAt}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true"	readOnlyInputText="true" />
				</h:column>

				<h:outputLabel	value="#{ msgs.ExpireOn} :" />
				<h:column>
				<p:calendar			id="begExpireOn"	value="#{academyBean.begExpireOn}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true" readOnlyInputText="true"  />
                      #{ msgs.To}
                      <p:calendar	id="endExpireOn"	value="#{academyBean.endExpireOn}"		locale="pt"		timeZone="Brazil/East" selectOtherMonths="true"	readOnlyInputText="true" />
				</h:column> 


				<h:outputLabel value="#{ msgs.Status}  :" />
				<p:selectOneRadio value="#{ academyBean.findByStatus}" >
					<f:selectItem itemLabel="#{ msgs.Active}" 		itemValue="true"  />
					<f:selectItem itemLabel="#{ msgs.Inactive}" 	itemValue="false" />
				</p:selectOneRadio>

			</h:panelGrid>
			<p:commandButton value="#{ msgs.Search}"	actionListener="#{academyBean.search}"	icon=" ui-icon-search"  process="@form" update=":listAcademyForm:academysTable,:growl" oncomplete="wfindAcademy.hide()" />
			<p:commandButton value="#{ msgs.Clear}"		type="button"	icon="ui-icon-clean">
				 <p:ajax update="findAcademyForm" resetValues="true" />  	
			</p:commandButton>
						
		</h:form>
	</p:dialog>

	<p:dialog id="dlgupload" header="#{msgs.Upload}" widgetVar="wdlgupload" modal="true" dynamic="true" style="min-width:500px;padding: 0px; margin: 0px;">
		<h:form  prependId="false" enctype="multipart/form-data">
				<p:fileUpload fileUploadListener="#{academyBean.uploadPhoto}" 
				mode="advanced" 
				styleClass="mobupload"
	            allowTypes="/(\.|\/)(jpg|jpeg)$/"
				sizeLimit="1073741824" 
				cancelLabel="#{msgs.Cancel}"
				label="#{msgs.SelectThePhoto}"
				uploadLabel="#{msgs.Upload}"
				oncomplete="wdlgupload.hide()"
				auto="true"
				invalidFileMessage="#{msgs.InvalidPhotoFormat}"
				update=":growl,:tabUser:academyForm:logoAcademy,:tabUser:academyForm:wideLogoAcademy" />
				<br/>
		</h:form>
	</p:dialog>

	<p:confirmDialog message="#{msgs.DoYouReallyWantToDeleteThisEntry}"	header="#{msgs.Warning}" severity="alert" widgetVar="wconfExcAcademy">
		<h:form prependId="false">
			<p:commandButton value="#{msgs.Yes}" oncomplete="wconfExcAcademy.hide();"	process="@form" actionListener="#{academyBean.deleteAcademy}"
				update=":listAcademyForm:academysTable, :growl, :content"  />
			<p:commandButton value="#{msgs.No }" onclick="wconfExcAcademy.hide();"	type="button" />
		</h:form>
	</p:confirmDialog>
	

</html>	